Skip to content

Merge material system surfaces#1662

Merged
VReaperV merged 5 commits into
DaemonEngine:masterfrom
VReaperV:material-merge-surfaces
May 22, 2025
Merged

Merge material system surfaces#1662
VReaperV merged 5 commits into
DaemonEngine:masterfrom
VReaperV:material-merge-surfaces

Conversation

@VReaperV

@VReaperV VReaperV commented May 6, 2025

Copy link
Copy Markdown
Contributor

Merges BSP surfaces for material system, with some limits on the total amount of tris in a surface (no splitting though) and the bounding sphere radius increase for merged surfaces.

This improves VS lane usage with material system. With r_profilerRenderSubGroups on and default parameters for subgroup profiler:
condemned-pve:
master:
unvanquished_2025-05-06_162435_000
This pr:
unvanquished_2025-05-06_162014_000
station12-b7:
master:
unvanquished_2025-05-06_162501_000
This pr:
unvanquished_2025-05-06_162050_000
prometheus:
master:
unvanquished_2025-05-06_162556_000
This pr:
unvanquished_2025-05-06_162306_000

Green = better usage of shader cores.

Also cleaned up some stuff that I decided not to use because this works well enough.

@VReaperV VReaperV added T-Improvement Improvement for an existing feature A-Renderer T-Cleanup labels May 6, 2025
@VReaperV VReaperV moved this to In Progress in Material system May 6, 2025
@VReaperV VReaperV force-pushed the material-merge-surfaces branch 2 times, most recently from db92d0b to 5d3fa7d Compare May 6, 2025 15:07
@enneract

enneract commented May 6, 2025

Copy link
Copy Markdown
Contributor

LGTM

@slipher

slipher commented May 6, 2025

Copy link
Copy Markdown
Member

Map atcshd is broken in various places.

unvanquished_2025-05-06_155646_000

@VReaperV

VReaperV commented May 6, 2025

Copy link
Copy Markdown
Contributor Author

Map atcshd is broken in various places.

unvanquished_2025-05-06_155646_000

Which settings? I'm not getting that issue on my end.

@slipher

slipher commented May 6, 2025

Copy link
Copy Markdown
Member

Disabling r_gpuFrustumCulling stops the bug there for me. The other day I had a bug with the frustum culling which was consistently reproducible at the time, but then a couple days later I couldn't reproduce it any more. Hopefully it's not like that...

@VReaperV

VReaperV commented May 6, 2025

Copy link
Copy Markdown
Contributor Author

I suspect there might be some clean-up missing if the map is not fully reloaded.

@slipher

slipher commented May 6, 2025

Copy link
Copy Markdown
Member

I do get missing surfaces even when it is the first map loaded.

@VReaperV

VReaperV commented May 6, 2025

Copy link
Copy Markdown
Contributor Author

That's weird...

@slipher

slipher commented May 6, 2025

Copy link
Copy Markdown
Member

You are deving with Windows + Nvidia right? On such a system I also get missing surfaces, albeit less glaring. Here's /setviewpos -1177 -585 41 -154 -29

unvanquished_2025-05-06_161719_000

@VReaperV

VReaperV commented May 6, 2025

Copy link
Copy Markdown
Contributor Author

You are deving with Windows + Nvidia right?

That is correct.

On such a system I also get missing surfaces, albeit less glaring. Here's /setviewpos -1177 -585 41 -154 -29

Oh, thx, I'm able to reproduce this one.

@VReaperV VReaperV force-pushed the material-merge-surfaces branch from 5d3fa7d to eabcd3d Compare May 6, 2025 23:03
@VReaperV

VReaperV commented May 6, 2025

Copy link
Copy Markdown
Contributor Author

You are deving with Windows + Nvidia right? On such a system I also get missing surfaces, albeit less glaring. Here's /setviewpos -1177 -585 41 -154 -29

unvanquished_2025-05-06_161719_000

Fixed.

@VReaperV

VReaperV commented May 6, 2025

Copy link
Copy Markdown
Contributor Author

Also added a commit which fixes totalDrawSurfs.

Comment thread src/engine/renderer/GeometryOptimiser.cpp Outdated
@VReaperV VReaperV force-pushed the material-merge-surfaces branch from eabcd3d to 0b77f1f Compare May 8, 2025 09:54
@VReaperV VReaperV force-pushed the material-merge-surfaces branch 4 times, most recently from 1170da2 to fc1ea89 Compare May 18, 2025 16:18
@VReaperV

Copy link
Copy Markdown
Contributor Author

Also updated the image in azure pipelines since the one we had is no longer supported.

@VReaperV VReaperV force-pushed the material-merge-surfaces branch from fc1ea89 to 0f59e69 Compare May 18, 2025 17:21
Comment thread src/engine/renderer/GeometryOptimiser.h Outdated
Comment thread src/engine/renderer/GeometryOptimiser.cpp Outdated
Comment thread src/engine/renderer/GeometryOptimiser.cpp Outdated
Comment thread src/engine/renderer/GeometryOptimiser.cpp Outdated
Comment thread src/engine/renderer/GeometryOptimiser.cpp
@VReaperV VReaperV force-pushed the material-merge-surfaces branch from 0f59e69 to b852c24 Compare May 19, 2025 08:47
Comment thread src/engine/renderer/GeometryOptimiser.cpp Outdated
Comment thread src/engine/renderer/GeometryOptimiser.cpp
Comment thread src/engine/renderer/GeometryOptimiser.cpp Outdated
Comment thread src/engine/renderer/GeometryOptimiser.cpp
Comment thread src/engine/renderer/Material.h Outdated
@slipher

slipher commented May 21, 2025

Copy link
Copy Markdown
Member

I pushed Update azure pipelines image to master so we can all benefit from it.

@VReaperV VReaperV force-pushed the material-merge-surfaces branch from 3d3639f to 087b546 Compare May 21, 2025 06:19
VReaperV added 3 commits May 21, 2025 09:25
Impoves VS lane usage.

The triangles are assigned to a grid with cell size dependent on map bounds. This allows fast merging without running out of memory.
Use a larger grid size for surfaces outside of the normal 64k range (background, skybrushes), to keep useable sizes for normal surfaces for culling.
@VReaperV VReaperV force-pushed the material-merge-surfaces branch from 087b546 to 995ad34 Compare May 21, 2025 06:33
@VReaperV VReaperV force-pushed the material-merge-surfaces branch from 995ad34 to ce99987 Compare May 21, 2025 15:12
@slipher

slipher commented May 22, 2025

Copy link
Copy Markdown
Member

LGTM

@VReaperV VReaperV merged commit 4a1e331 into DaemonEngine:master May 22, 2025
9 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Material system May 22, 2025
@VReaperV VReaperV deleted the material-merge-surfaces branch May 22, 2025 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Renderer T-Cleanup T-Improvement Improvement for an existing feature

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants